package com.Cychat.schedule.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.Cychat.commons.entity.pojo.Pet;
import com.Cychat.schedule.mapper.PetMapper;
import com.Cychat.schedule.service.PetService;
import org.springframework.stereotype.Service;
import java.util.List;
/**
 * Auther: 谢宝辉  <br/>
 * Date: 2025/10/28:20:13  <br/>
 * Description: 宠物服务实现类
 */

@Service
public class PetServiceImpl extends ServiceImpl<PetMapper, Pet> implements PetService {

    /**
     * Auther: 谢宝辉  <br/>
     * Date: 2025/10/28:20:14  <br/>
     * Description: 根据主人ID获取宠物列表
     */
    @Override
    public List<Pet> getPetsByOwnerId(Integer ownerId) {
        LambdaQueryWrapper<Pet> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(Pet::getOwnerId, ownerId);
        return list(queryWrapper);
    }
}